<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Retrieve information about a file</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="streamwrapper.unlink.html">streamWrapper::unlink</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="ref.stream.html">Stream 函数</a></div>
 <div class="up"><a href="class.streamwrapper.html">streamWrapper</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="streamwrapper.url-stat" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">streamWrapper::url_stat</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.3.2, PHP 5)</p><p class="refpurpose"><span class="refname">streamWrapper::url_stat</span> &mdash; <span class="dc-title">Retrieve information about a file</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-streamwrapper.url-stat-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">array</span> <span class="methodname"><strong>streamWrapper::url_stat</strong></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$path</code></span>
   , <span class="methodparam"><span class="type">int</span> <code class="parameter">$flags</code></span>
   )</div>

  <p class="para rdfs-comment">
   This method is called in response to all <span class="function"><a href="function.stat.html" class="function">stat()</a></span> related
   functions, such as:
   <ul class="simplelist">
    <li class="member"><span class="function"><a href="function.chmod.html" class="function">chmod()</a></span> (only when <a href="ini.sect.safe-mode.html#ini.safe-mode" class="link">safe_mode</a> is enabled)</li>
    <li class="member"><span class="function"><a href="function.copy.html" class="function">copy()</a></span></li>
    <li class="member"><span class="function"><a href="function.fileperms.html" class="function">fileperms()</a></span></li>
    <li class="member"><span class="function"><a href="function.fileinode.html" class="function">fileinode()</a></span></li>
    <li class="member"><span class="function"><a href="function.filesize.html" class="function">filesize()</a></span></li>
    <li class="member"><span class="function"><a href="function.fileowner.html" class="function">fileowner()</a></span></li>
    <li class="member"><span class="function"><a href="function.filegroup.html" class="function">filegroup()</a></span></li>
    <li class="member"><span class="function"><a href="function.fileatime.html" class="function">fileatime()</a></span></li>
    <li class="member"><span class="function"><a href="function.filemtime.html" class="function">filemtime()</a></span></li>
    <li class="member"><span class="function"><a href="function.filectime.html" class="function">filectime()</a></span></li>
    <li class="member"><span class="function"><a href="function.filetype.html" class="function">filetype()</a></span></li>
    <li class="member"><span class="function"><a href="function.is-writable.html" class="function">is_writable()</a></span></li>
    <li class="member"><span class="function"><a href="function.is-readable.html" class="function">is_readable()</a></span></li>
    <li class="member"><span class="function"><a href="function.is-executable.html" class="function">is_executable()</a></span></li>
    <li class="member"><span class="function"><a href="function.is-file.html" class="function">is_file()</a></span></li>
    <li class="member"><span class="function"><a href="function.is-dir.html" class="function">is_dir()</a></span></li>
    <li class="member"><span class="function"><a href="function.is-link.html" class="function">is_link()</a></span></li>
    <li class="member"><span class="function"><a href="function.file-exists.html" class="function">file_exists()</a></span></li>
    <li class="member"><span class="function"><a href="function.lstat.html" class="function">lstat()</a></span></li>
    <li class="member"><span class="function"><a href="function.stat.html" class="function">stat()</a></span></li>
    <li class="member"><span class="methodname"><a href="splfileinfo.getperms.html" class="methodname">SplFileInfo::getPerms()</a></span></li>
    <li class="member"><span class="methodname"><a href="splfileinfo.getinode.html" class="methodname">SplFileInfo::getInode()</a></span></li>
    <li class="member"><span class="methodname"><a href="splfileinfo.getsize.html" class="methodname">SplFileInfo::getSize()</a></span></li>
    <li class="member"><span class="methodname"><a href="splfileinfo.getowner.html" class="methodname">SplFileInfo::getOwner()</a></span></li>
    <li class="member"><span class="methodname"><a href="splfileinfo.getgroup.html" class="methodname">SplFileInfo::getGroup()</a></span></li>
    <li class="member"><span class="methodname"><a href="splfileinfo.getatime.html" class="methodname">SplFileInfo::getATime()</a></span></li>
    <li class="member"><span class="methodname"><a href="splfileinfo.getmtime.html" class="methodname">SplFileInfo::getMTime()</a></span></li>
    <li class="member"><span class="methodname"><a href="splfileinfo.getctime.html" class="methodname">SplFileInfo::getCTime()</a></span></li>
    <li class="member"><span class="methodname"><a href="splfileinfo.gettype.html" class="methodname">SplFileInfo::getType()</a></span></li>
    <li class="member"><span class="methodname"><a href="splfileinfo.iswritable.html" class="methodname">SplFileInfo::isWritable()</a></span></li>
    <li class="member"><span class="methodname"><a href="splfileinfo.isreadable.html" class="methodname">SplFileInfo::isReadable()</a></span></li>
    <li class="member"><span class="methodname"><a href="splfileinfo.isexecutable.html" class="methodname">SplFileInfo::isExecutable()</a></span></li>
    <li class="member"><span class="methodname"><a href="splfileinfo.isfile.html" class="methodname">SplFileInfo::isFile()</a></span></li>
    <li class="member"><span class="methodname"><a href="splfileinfo.isdir.html" class="methodname">SplFileInfo::isDir()</a></span></li>
    <li class="member"><span class="methodname"><a href="splfileinfo.islink.html" class="methodname">SplFileInfo::isLink()</a></span></li>
    <li class="member"><span class="methodname"><a href="recursivedirectoryiterator.haschildren.html" class="methodname">RecursiveDirectoryIterator::hasChildren()</a></span></li>
   </ul>
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-streamwrapper.url-stat-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>
<em><code class="parameter">path</code></em></dt>

     <dd>

      <p class="para">
       The file path or URL to stat.  Note that in the case of a URL, it must be a :// delimited
       URL.  Other URL forms are not supported.
      </p>
     </dd>

    
    
     <dt>
<em><code class="parameter">flags</code></em></dt>

     <dd>

      <p class="para">
       Holds additional flags set by the streams API. It can hold one or more
       of the following values OR&#039;d together.
       <table class="doctable informaltable">
        
         <thead>
          <tr>
           <th>Flag</th>
           <th>Description</th>
          </tr>

         </thead>

         <tbody class="tbody">
          <tr>
           <td>STREAM_URL_STAT_LINK</td>
           <td>
            For resources with the ability to link to other resource
            (such as an HTTP Location: forward, or a filesystem
            symlink).  This flag specified that only information
            about the link itself should be returned, not the
            resource pointed to by the link.  This flag is set in
            response to calls to <span class="function"><a href="function.lstat.html" class="function">lstat()</a></span>,
            <span class="function"><a href="function.is-link.html" class="function">is_link()</a></span>, or <span class="function"><a href="function.filetype.html" class="function">filetype()</a></span>.
           </td>
          </tr>

          <tr>
           <td>STREAM_URL_STAT_QUIET</td>
           <td>If this flag is set, your wrapper should not raise any
            errors.  If this flag is not set, you are responsible for
            reporting errors using the <span class="function"><a href="function.trigger-error.html" class="function">trigger_error()</a></span>
            function during stating of the path.
           </td>
          </tr>

         </tbody>
        
       </table>

      </p>
     </dd>

    
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-streamwrapper.url-stat-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Should return as many elements as <span class="function"><a href="function.stat.html" class="function">stat()</a></span> does.
   Unknown or unavailable values should be set to a rational value
   (usually <strong><code>0</code></strong>).
  </p>
 </div>


 <div class="refsect1 errors" id="refsect1-streamwrapper.url-stat-errors">
  <h3 class="title">错误／异常</h3>
  <p class="para">调用此方法失败将给出
<strong><code>E_WARNING</code></strong>（未实现）。</p>
 </div>

 
 

 <div class="refsect1 notes" id="refsect1-streamwrapper.url-stat-notes">
  <h3 class="title">注释</h3>
  <blockquote class="note"><p><strong class="note">Note</strong>: <p class="para">当合法的上下文传递给调用函数时，属性
<var class="varname"><var class="varname">streamWrapper::$context</var></var>
会被改变。</p></p></blockquote>
 </div>

 
 <div class="refsect1 seealso" id="refsect1-streamwrapper.url-stat-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="function"><a href="function.stat.html" class="function" rel="rdfs-seeAlso">stat()</a> - 给出文件的信息</span></li>
    <li class="member"><span class="methodname"><a href="streamwrapper.stream-stat.html" class="methodname" rel="rdfs-seeAlso">streamwrapper::stream_stat()</a> - Retrieve information about a file resource</span></li>
   </ul>
  </p>
 </div>


</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="streamwrapper.unlink.html">streamWrapper::unlink</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="ref.stream.html">Stream 函数</a></div>
 <div class="up"><a href="class.streamwrapper.html">streamWrapper</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
